/**
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@import '~/styles/variables';

.descriptionsWrapper {
  position: relative;
}

.macroDescription {
  color: $dark;
  max-width: 36.7rem;
  position: relative;

  @media screen and (min-width: $medium) {
    padding-right: 4.8rem;
  }

  @media screen and (min-width: $large) {
    padding-right: 0;
  }

  .icon {
    display: block;
    margin-bottom: 1.6rem;
    width: 6rem;
  }

  h1 {
    margin-bottom: 2.4rem;
  }

  .description {
    font-size: $base_font_size;
    line-height: 2rem;
    margin-bottom: 3.6rem;

    a {
      color: $dark;
      display: block;
      line-height: 2rem;
    }
  }

  .lupeLink {
    align-items: center;
    color: $dark;
    display: inline-flex;
    gap: 0.9rem;
    padding-bottom: 1rem;
    text-decoration: none;

    span {
      color: $dark;
      font-size: 1.2rem;
      font-weight: 700;
      line-height: 2.3rem;
      text-transform: uppercase;
    }
  }

  &.currentMacroDescription {
    .icon {
      opacity: 0;
    }

    h1 {
      opacity: 0;
      transform: translateY(10px);
    }

    .description {
      opacity: 0;
    }

    .lupeLink {
      opacity: 0;
    }

    &.show {
      .icon {
        opacity: 1;
        transition: opacity $fadeDuration ease-out;
      }

      h1 {
        opacity: 1;
        transform: translateY(0px);

        transition: opacity $fadeDuration ease-out,
          transform $fadeDuration ease-out;
      }

      .description {
        opacity: 1;
        transition: opacity $fadeDuration ease-out;
      }

      .lupeLink {
        opacity: 1;
        transition: opacity $fadeDuration ease-out;
      }
    }
  }

  &.previousMacroDescription {
    left: 0;
    position: absolute;
    top: 0;

    .icon {
      opacity: 1;
    }

    h1 {
      opacity: 1;
      transform: translateY(0px);
    }

    .description {
      opacity: 1;
    }

    .lupeLink {
      opacity: 1;
    }

    &.hide {
      .icon {
        opacity: 0;
        transition: opacity $fadeDuration ease-out;
      }

      h1 {
        opacity: 0;
        transform: translateY(-10px);

        transition: opacity $fadeDuration ease-out,
          transform $fadeDuration cubic-bezier(0.37, 0.18, 0.19, 1);
      }

      .description {
        opacity: 0;
        transition: opacity $fadeDuration ease-out;
      }

      .lupeLink {
        opacity: 0;
        transition: opacity $fadeDuration ease-out;
      }
    }
  }
}

.videoPopup {
  align-items: center;
  background: rgba(21, 21, 21, 0.5);
  display: flex;
  height: 100%;
  justify-content: center;
  left: 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;

  .videoPopupContent {
    width: 90%;

    @media screen and (min-width: $medium) {
      width: 65%;
    }
  }

  .videoBox {
    background-color: $dark;
    height: 0;
    overflow: hidden;
    padding-bottom: 56.25%;
    position: relative;
    width: 100%;

    iframe {
      border: none;
      height: 100%;
      left: 0;
      position: absolute;
      top: 0;
      width: 100%;
    }
  }
}

.videoPopup {
  align-items: center;
  background: rgba(21, 21, 21, 0.5);
  display: flex;
  height: 100%;
  justify-content: center;
  left: 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;

  .videoPopupContent {
    width: 90%;

    @media screen and (min-width: $medium) {
      width: 65%;
    }
  }

  .videoBox {
    height: 0;
    overflow: hidden;
    padding-bottom: 56.25%;
    position: relative;
    width: 100%;

    iframe {
      height: 100%;
      left: 0;
      position: absolute;
      top: 0;
      width: 100%;
    }
  }
}
